package controllers

import (
	"github.com/astaxie/beego"
	"softwareEngineering/models"
)

type SubCase struct {
	beego.Controller
}

func (c *SubCase) ShowSub() {
	u := c.Ctx.Input.Session("user")
	if u != nil {
		user := c.Ctx.Input.Session("user").(models.User)
		c.Data["user"] = user
	}
	subcases := QuerySubCasesByDisplay()
	c.Data["subcases"] = subcases
	subcaseImagePath := GetSubcaseImagePath(subcases)
	c.Data["subImgPat"] = subcaseImagePath
	c.TplName = "subCase.html"

}
